package com.web44.mapper;

import com.web44.bean.User;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @Title: UserMapper
 * @Description:
 * @Auther: py
 * @Version: 1.0
 * @create 2024/1/3 9:06
 */
public interface UserMapper {
    /**
     * 新增用户
     * @param user
     */
    void addUser(User user);

    void editUser(@Param("user") User user);

    void deleteUser(Integer id);

    User queryUserById(Integer id);

    List<User> queryUsers();

    List<User> queryUsersByMap();

    Integer queryCount();

    @MapKey("id")
    Map<String,Object> queryUsersMap();

    @MapKey("id")
    Map<String,User> queryUsersMap2();

    List<User> queryUsersByName(@Param("username") String username);

    List<User> queryUsersByName2(@Param("username") String username);

    List<User> queryUsersByName3( String username);

    int insertUser(@Param("user") User user);

    void deleteBatch(@Param("ids") String ids);

}